/*
* $Id: AddChangeFamilyView.h 273 2011-02-21 20:46:41Z volok-aleksej@yandex.ru $
*
* Copyright 2008-2010 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _ADD_CHANGE_FAMILY_VIEW_H_
#define _ADD_CHANGE_FAMILY_VIEW_H_

#include "AddChangeView.h"
#include "Components/Journal/FamilyManager.h"

class CComboBoxItem;

class CAddChangeFamilyView : public CAddChangeView
{
	int m_nUserFields;
protected:
	int m_nIdRecord;
protected:
	virtual std::tstring GetHeaderString() = 0;
protected:
	void Init();
	void GetCurValue();
	void GetSaveData(CFamilyManager::family& fml,
		std::map<std::tstring, std::tstring>& aUserField);
	void AddTypesFamily(CComboBoxItem* pItem);
	void AddPoints(CComboBoxItem* pItem);
public:
	CAddChangeFamilyView(CState* pState);
	virtual ~CAddChangeFamilyView();
};

class CAddFamilyView : public CAddChangeFamilyView
{
protected:
	virtual std::tstring GetHeaderString();
protected:
	DECLARE_MESSAGE_MAP();
	afx_msg void OnSaveFamily();
public:
	CAddFamilyView(CState* pState);
	virtual ~CAddFamilyView();
public:
	virtual void SetState();
	virtual bool IsViewState(State state);
};

class CChangeFamilyView : public CAddChangeFamilyView
{
protected:
	virtual std::tstring GetHeaderString();
	virtual void InitCurrentValue();
protected:
	DECLARE_MESSAGE_MAP();
	afx_msg void OnSaveFamily();
public:
	CChangeFamilyView(CState* pState);
	virtual ~CChangeFamilyView();
public:
	virtual void SetState();
	virtual bool IsViewState(State state);
};

#endif/*_ADD_CHANGE_FAMILY_VIEW_H_*/